<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<div class="easyui-layout" style="width:100%;height:100%;" fit="true">
	<div data-options="region:'north',title:'数据库备份',split:true" style="height:70px;background-color:#e6edfd;">
    	<form action="" id="searchForm" name="searchForm">
    	<table class="screen">
			<tr>
				<td class="screen-n"><span>选择系统</span></td>
				<td class="screen-n">
					<select id="dbChoose">
						<option value="">-请选择-</option>
						<option value="TK.WEB">-宣城医药在线WEB数据库-</option>
						<option value="TK.XDI">-宣城医药在线XDI数据库-</option>
					</select>
				</td>
				<td class="screen-n"><span>账号</span></td>
				<td class="screen-n">
					<input type="text" id="user" name="user" class="screen-input"  onkeydown="pms.kd13('initList')">
				</td>
				<td class="screen-n"><span>密码</span></td>
				<td class="screen-n">
					<input type="text" id="pwd" name="pwd" class="screen-input"  onkeydown="pms.kd13('initList')">
				</td>
				<td class="screen-n"><span>SID</span></td>
				<td class="screen-n">
					<input type="text" id="sid" name="sid" class="screen-input"  onkeydown="pms.kd13('initList')">
				</td>
				<td class="screen-n">
					<input type="button" class="button" value="开始备份" onclick="backDB()">
				</td>
			</tr>
		</table>
		</form>
    </div>
    
    
    <div data-options="region:'center',split:true" style="width: 100%;height: 100%">
		<table id="tableGrid"></table>
	</div>
</div>
<script>
function backDB(){
	var param = {
			"user":$("#user").val(),
			"pwd":$("#pwd").val(),
			"sid":$("#sid").val(),
			"savePath":$("#savePath").val()
			};
	$.pmsAjax({
		url:'<c:url value="/db/backOracleDB.do"/>',
		data:param,
		message:'数据库备份中  预计需要几分钟 请耐心等待!备份完成可查看对应结果日志',
		success:function(data){
			if(data.code=="200"){
				alertShow("新增成功");
			}else{
				alertError(data.result);
			}
		},
	});
}
$("#dbChoose").change(function(){
	if($(this).val()=="TK.WEB"){
		 $("#user").val("B2B"),
		 $("#pwd").val("B2B"),
		 $("#sid").val("ORCL"),
		 $("#savePath").val("D:\\dbback\\oralce\\")
	}
	
});
</script>
